package example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("/system/api/session-A")
public class SessionAController {

    //指的是session不加入到redis
    // http:localhost:8111/dns-a/system/api/session-A/redis-A-no
    @RequestMapping("/redis-A-no")
    public String redisANoSession() {
        return "系统-A-无session加入到redis";
    }

    //session加入到redis
    // http:localhost:8111/dns-a/system/api/session-A/redis-A-has
    @RequestMapping("/redis-A-has")
    public String redisAHasSession(HttpSession httpSession) {
        httpSession.setAttribute("wahaha", "wahaha");
        return "系统-A-有session加入到redis";
    }

}
